package ro.uaic.info.fmse.context.transformers.items;

import ro.uaic.info.fmse.context.transformers.enums.Multiplicity;

public class ConfigurationNode extends MyCloneable {
	public Multiplicity multiplicity, inherited;
	private int id;

	public ConfigurationNode(Multiplicity multiplicity, Multiplicity inherited) {
		this.multiplicity = multiplicity;
		this.inherited = inherited;
		id = this.hashCode();
	}

	@Override
	public String toString() {
//		return multiplicity.toString() + "," + inherited.toString() + ",(" + id
//				+ ")";
		return multiplicity.toString();
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		return new ConfigurationNode(multiplicity, inherited);
	}

	@Override
	public Object getClone() throws CloneNotSupportedException {
		return clone();
	}

	public int getId() {
		return id;
	}

	@Override
	public boolean equals(Object obj) {
		ConfigurationNode cn = (ConfigurationNode) obj;
		return cn.id == id;
	}
}